<template>
    <div>
  <div class="container">
    <div class="page-title-normal">
      <h2 class="page-title-h2"><span>check out</span></h2>
    </div>
    <!-- 进度条 -->
    <div class="check-step">
      <ul>
        <li class="cur"><span>Confirm</span> address</li>
        <li class="cur"><span>View your</span> order</li>
        <li class="cur"><span>Make</span> payment</li>
        <li class="cur"><span>Order</span> confirmation</li>
      </ul>
    </div>

    <div class="order-create">
      <div class="order-create-pic"><img src="../../assets/images/ok-2.png" alt=""></div>
      <div class="order-create-main">
        <h3>Congratulations! <br>Your order is under processing!</h3>
        <p>
          <span>Order ID：{{orderId}}</span>
          <span>Order total：{{totalPrice}}</span>
        </p>
        <div class="order-create-btn-wrap">
          <div class="btn-l-wrap">
            <router-link href="javascript:;" class="btn btn--m" to="/cart">Cart List</router-link>
          </div>
          <div class="btn-r-wrap">
            <router-link href="javascript:;" class="btn btn--m" to="/goodlist">Goods List</router-link>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</template>
<script>
export default {
    name:'Finish',
    data(){
        return{
            orderId:'',
            totalPrice:0
        }
    },
    methods:{
        init(){
            this.axios.post('http://127.0.0.1:3333/getOrder',{orderId:this.orderId}).then((res)=>{
                //console.log(res);
                if(res.data.status == '0'){
                    this.totalPrice = res.data.result.orderTotal;
                }
            }).catch((err)=>{
                console.log(err);
            })
        }
    },
    mounted(){
        this.orderId = this.$route.params.orderId;
        this.init();
    }

}
</script>
<style scoped>

</style>